
git submodule update --init

CURRENT_PATH=`pwd`
### install NuRaft


if [ ! -d $CURRENT_PATH/dep_libs/nuraft ]; then

echo "*********** Begin install NuRaft *************"

cd $CURRENT_PATH/third_party/NuRaft
./prepare.sh

rm -rf build
mkdir build
cd build

cmake -DCMAKE_INSTALL_PREFIX=$CURRENT_PATH/dep_libs/nuraft ..

make -j4 && make install

cd $CURRENT_PATH

echo "*********** Done install NuRaft *************"

fi

if [ ! -d $CURRENT_PATH/dep_libs/leveldb ]; then

echo "*********** Begin install leveldb *************"

cd $CURRENT_PATH/third_party/leveldb

git submodule update --init

rm -rf build

mkdir build
cd build

cmake -DCMAKE_INSTALL_PREFIX=$CURRENT_PATH/dep_libs/leveldb ..

make -j4 && make install

cd $CURRENT_PATH

echo "*********** Done install leveldb *************"

fi

if [ ! -d $CURRENT_PATH/dep_libs/poco ]; then

echo "*********** Begin install poco *************"

cd $CURRENT_PATH/third_party/poco

mkdir cmake-build
cd cmake-build

cmake -DCMAKE_INSTALL_PREFIX=$CURRENT_PATH/dep_libs/poco ..

make -j4 && make install

cd $CURRENT_PATH

echo "*********** Done install poco *************"

fi
